define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'shop.platform_goods/index',
        add_url: 'shop.platform_goods/add',
        edit_url: 'shop.platform_goods/edit',
        delete_url: 'shop.platform_goods/delete',
        export_url: 'shop.platform_goods/export',
        modify_url: 'shop.platform_goods/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                toolbar:['refresh','add','delete'],
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: 'id'},
                    {field: 'shop_id', title: '店铺ID',hide:true},
                    {field: 'shop_name', title: '店铺名称',search:false},
                    {field: 'goods_title', title: '商品名称'},
                    {field: 'goods_img', title: '商品图片',templet: ea.table.image,search:false},
                    {field: 'status', title: '状态', templet: ea.table.switch},
                    {field: 'create_time', title: '添加时间'},
                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
				done: function (){
                    $(".layui-table-body>table>tbody>tr").each(function (index, val) {
                        $($(".layui-table-fixed .layui-table-body table tr")[index]).height($(val).height());
                    });
                },
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});